#include<iostream>
#include<vector>
//#define max(a,b) (a ? (a > b) : b)
#include<math.h>
using namespace std;

int maxSubsetSum(vector<int> array) {
  vector<int> ans {};
  ans.push_back(array[0]);
  ans.push_back(max(array[0], array[1]));
  for (int i = 2; i < array.size(); ++i) {
      ans.push_back(max(ans[i-2] + array[i], ans[i - 1]));
  }
  return *(ans.end() - 1) ;
}

int main(int argc, char const *argv[]){
  vector<int> array = {75, 105, 120, 75, 90, 135};
  cout << maxSubsetSum(array);
  return 0;
}
